static const float PI = 3.14159265f;
static const float3 STANDARD_vDiffuseLight = float3( 1.0f, 1.0f, 1.0f );
static const float STANDARD_vIntensity = 1.2f;

float3 GetOverlay( float3 vColor, float3 vOverlay, float vOverlayPercent )
{
	float3 vRes;
	vRes.r = vOverlay.r < 0.5f ? (2 * vOverlay.r * vColor.r) : (1 - 2 * (1 - vOverlay.r) * (1 - vColor.r));
	vRes.g = vOverlay.g < 0.5f ? (2 * vOverlay.g * vColor.g) : (1 - 2 * (1 - vOverlay.g) * (1 - vColor.g));
	vRes.b = vOverlay.b < 0.5f ? (2 * vOverlay.b * vColor.b) : (1 - 2 * (1 - vOverlay.b) * (1 - vColor.b));
	return lerp( vColor, vRes, vOverlayPercent );
}

float3 CalculateLighting( float3 vColor, float3 vNormal )
{
	float3 vLightDirection = float3( 0.f, -1.f, 0.f );
	float NdotL = dot( vNormal, -vLightDirection );

	float vAmbient = 0.2f;

	float vHalfLambert = pow( NdotL * 0.5f + 0.5f, 2 );

	vHalfLambert = vAmbient + ( 1.0f - vAmbient ) * vHalfLambert;

	return saturate( vHalfLambert * vColor * STANDARD_vDiffuseLight * STANDARD_vIntensity );
}